/*
 * bleusart.h
 *
 *  Created on: 2016-7-22
 *      Author: NKJ
 */

#ifndef BLEUSART_H_
#define BLEUSART_H_

#include "stdlib.h"
#include "stdio.h"
#include "string.h"
#include "em_usart.h"
#include "em_ldma.h"
#include "em_int.h"
#include "em_gpio.h"
#include "em_cmu.h"
#include "InitDevice.h"



#define BLEUSARTx				USART0
#define BLEHRM_RX_IRQHandler	USART0_RX_IRQHandler
#define CTLPORT					gpioPortF
#define CTLPIN					2

#define RXBUFSIZE    			19                      /**< Buffer size for RX */

extern uint32_t baud;
extern uint8_t rxBuffer[RXBUFSIZE];
extern uint8_t rxWriteIndex;

extern uint8_t elc;
extern uint8_t hrm;
extern uint8_t ok;

void BLE_USARTInit(uint32_t baud);



#endif /* BLEUSART_H_ */
